<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/6/3
 * Time: 10:53
 */

namespace app\applet\model;


use think\Db;

class Test
{
    public function test($current_page,$page_num,$where)
    {
        $data = Db::name("member")
            ->field("member_id,openid,nickName")
            ->where($where)
            ->page($current_page,$page_num)
            ->select();
        $total_num = Db::name("member")
            ->where($where)
            ->count();
        $list['current_page'] = $current_page;
        $list['total_page'] = ceil($total_num / $page_num);
        $list['page_num'] = $page_num;
        $list['total_num'] = $total_num;
        $list['data'] = $data;
        return $list;
    }
    #定时任务，输出1
    public function test1()
    {
        echo "执行时间".date("Ymd His").PHP_EOL;die;
    }

}